package com.example.asus.testskip.DGPhone;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.telephony.SmsMessage;

/* renamed from: dg.ca.com.DGPhone.SMS_Receiver */
public class SMS_Receiver extends BroadcastReceiver {
    final String GetNumberAddress = "10001";

    public void onReceive(Context context, Intent intent) {
        if (intent.getAction().equals("android.provider.Telephony.SMS_RECEIVED")) {
            Object[] pdus = (Object[]) intent.getExtras().get("pdus");
            SmsMessage[] message = new SmsMessage[pdus.length];
            StringBuilder sb = new StringBuilder();
            System.out.println("pdus长度" + pdus.length);
            String address = "";
            for (int i = 0; i < pdus.length; i++) {
                message[i] = SmsMessage.createFromPdu((byte[]) pdus[i]);
                sb.append("接收到短信来自:\n");
                address = message[i].getDisplayOriginatingAddress();
                sb.append(address + "\n");
                sb.append("内容:" + message[i].getDisplayMessageBody());
            }
            System.out.println(sb.toString());
            if (SMSCore.PhoneNumber == "" && address.equals("10001")) {
                SMSCore.PhoneNumber = SMSCore.GetPhoneNumberFromSMSText(sb.toString());
                MessageTools.ShowDialog(context, address);
            }
            MessageTools.ShowDialog(context, sb.toString().trim());
            MessageTools.ShowDialog(context, SMSCore.PhoneNumber);
        }
    }
}
